package kr.hkit.androidcomplete01.ch13;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;

public class CalendarViewTest extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.ch13_calendarviewtest);
		
		CalendarView calendar = (CalendarView) findViewById(R.id.calendar);
		calendar.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
			
			@Override
			public void onSelectedDayChange(CalendarView view, int year, int month,
					int dayOfMonth) {
				Toast.makeText(CalendarViewTest.this, "" + year + "/" + (month+1) + "/" + dayOfMonth,0).show();
			}
		});
		
	}

}
